package com.monbo.proj.lifangcrm.entity.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import jakarta.persistence.*;
import lombok.Data;
import org.hibernate.annotations.ColumnDefault;

import java.time.Instant;

/**
 * hbiz附件
 *
 * @author lirui
 * @date 2025/09/22
 */
@Data
@Entity
@Table(name = "h_biz_attachment")
public class HBizAttachment {
    @Id
    @Column(name = "id", nullable = false, length = 120)
    private String id;

    @Column(name = "bizObjectId", nullable = false, length = 200)
    @TableField("bizObjectId")
    private String bizObjectId;

    @Column(name = "bizPropertyCode", nullable = false, length = 40)
    @TableField("bizPropertyCode")
    private String bizPropertyCode;

    @Column(name = "createdTime")
    @TableField("createdTime")
    private Instant createdTime;

    @Column(name = "creater", length = 36)
    @TableField("creater")
    private String creater;

    @Column(name = "fileExtension", length = 30)
    @TableField("fileExtension")
    private String fileExtension;

    @Column(name = "fileSize")
    @TableField("fileSize")
    private Integer fileSize;

    @Lob
    @Column(name = "base64ImageStr")
    @TableField("base64ImageStr")
    private String base64ImageStr;

    @Column(name = "mimeType", length = 50)
    @TableField("mimeType")
    private String mimeType;

    @Column(name = "name", length = 200)
    @TableField("name")
    private String name;

    @ColumnDefault("")
    @Column(name = "parentBizObjectId", length = 36)
    @TableField("parentBizObjectId")
    private String parentBizObjectId;

    @Column(name = "parentSchemaCode", length = 36)
    @TableField("parentSchemaCode")
    private String parentSchemaCode;

    @Column(name = "refId", nullable = false, length = 500)
    @TableField("refId")
    private String refId;

    @Column(name = "schemaCode", nullable = false, length = 36)
    @TableField("schemaCode")
    private String schemaCode;

    @Column(name = "sortKey")
    @TableField("sortKey")
    private Integer sortKey;

}